home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / mcsanit / frmmcsan.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-08-24  |  16.8 KB  |  492 lines

  1. VERSION 5.00
  2. Object = "{2C910558-3DA7-11D2-8B30-006097A8F11E}#1.0#0"; "MCSANITIZER.OCX"
  3. Begin VB.Form frmMCSanitizerDemo 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "mcSanitizer : Demo"
  6.    ClientHeight    =   4980
  7.    ClientLeft      =   45
  8.    ClientTop       =   615
  9.    ClientWidth     =   8835
  10.    Icon            =   "frmMCSanitizerDemo.frx":0000
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4980
  14.    ScaleWidth      =   8835
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin MC_Sanitizer.mcSanitizer mcSanitizer1 
  17.       Left            =   8190
  18.       Top             =   4320
  19.       _ExtentX        =   847
  20.       _ExtentY        =   847
  21.    End
  22.    Begin VB.Frame Frame3 
  23.       Caption         =   "Sanitize in progress ..."
  24.       Height          =   1545
  25.       Left            =   90
  26.       TabIndex        =   21
  27.       Top             =   3330
  28.       Width           =   5235
  29.       Begin VB.Line Line1 
  30.          BorderColor     =   &H00808080&
  31.          X1              =   2475
  32.          X2              =   2475
  33.          Y1              =   180
  34.          Y2              =   1440
  35.       End
  36.       Begin VB.Label lblTime 
  37.          Alignment       =   1  'Right Justify
  38.          BorderStyle     =   1  'Fixed Single
  39.          Height          =   285
  40.          Index           =   2
  41.          Left            =   4500
  42.          TabIndex        =   36
  43.          Top             =   1080
  44.          Width           =   555
  45.       End
  46.       Begin VB.Label lblTime 
  47.          Alignment       =   1  'Right Justify
  48.          BorderStyle     =   1  'Fixed Single
  49.          Height          =   285
  50.          Index           =   1
  51.          Left            =   4500
  52.          TabIndex        =   34
  53.          Top             =   720
  54.          Width           =   555
  55.       End
  56.       Begin VB.Label lblTime 
  57.          Alignment       =   1  'Right Justify
  58.          BorderStyle     =   1  'Fixed Single
  59.          Height          =   285
  60.          Index           =   0
  61.          Left            =   4500
  62.          TabIndex        =   32
  63.          Top             =   360
  64.          Width           =   555
  65.       End
  66.       Begin VB.Label Label5 
  67.          AutoSize        =   -1  'True
  68.          Caption         =   "Elapsed time step 3"
  69.          Height          =   195
  70.          Left            =   2610
  71.          TabIndex        =   35
  72.          Top             =   1080
  73.          Width           =   1380
  74.       End
  75.       Begin VB.Label Label4 
  76.          AutoSize        =   -1  'True
  77.          Caption         =   "Elapsed time step 2"
  78.          Height          =   195
  79.          Left            =   2610
  80.          TabIndex        =   33
  81.          Top             =   720
  82.          Width           =   1380
  83.       End
  84.       Begin VB.Label Label3 
  85.          AutoSize        =   -1  'True
  86.          Caption         =   "Elapsed time step 1"
  87.          Height          =   195
  88.          Left            =   2610
  89.          TabIndex        =   31
  90.          Top             =   360
  91.          Width           =   1380
  92.       End
  93.       Begin VB.Label lblParts 
  94.          Alignment       =   1  'Right Justify
  95.          BorderStyle     =   1  'Fixed Single
  96.          Height          =   285
  97.          Left            =   1800
  98.          TabIndex        =   30
  99.          Top             =   1080
  100.          Width           =   555
  101.       End
  102.       Begin VB.Label lblSteps 
  103.          Alignment       =   1  'Right Justify
  104.          BorderStyle     =   1  'Fixed Single
  105.          Height          =   285
  106.          Left            =   1800
  107.          TabIndex        =   27
  108.          Top             =   720
  109.          Width           =   555
  110.       End
  111.       Begin VB.Label lblPassages 
  112.          Alignment       =   1  'Right Justify
  113.          BorderStyle     =   1  'Fixed Single
  114.          Height          =   285
  115.          Left            =   1800
  116.          TabIndex        =   24
  117.          Top             =   360
  118.          Width           =   555
  119.       End
  120.       Begin VB.Label Label1 
  121.          AutoSize        =   -1  'True
  122.          Caption         =   "Passage"
  123.          Height          =   195
  124.          Index           =   0
  125.          Left            =   270
  126.          TabIndex        =   22
  127.          Top             =   360
  128.          Width           =   615
  129.       End
  130.       Begin VB.Label Label1 
  131.          AutoSize        =   -1  'True
  132.          Caption         =   "Step"
  133.          Height          =   195
  134.          Index           =   1
  135.          Left            =   270
  136.          TabIndex        =   25
  137.          Top             =   720
  138.          Width           =   330
  139.       End
  140.       Begin VB.Label Label1 
  141.          AutoSize        =   -1  'True
  142.          Caption         =   "Part"
  143.          Height          =   195
  144.          Index           =   2
  145.          Left            =   270
  146.          TabIndex        =   28
  147.          Top             =   1080
  148.          Width           =   285
  149.       End
  150.       Begin VB.Label lblPassage 
  151.          Alignment       =   1  'Right Justify
  152.          BorderStyle     =   1  'Fixed Single
  153.          Height          =   285
  154.          Left            =   1170
  155.          TabIndex        =   23
  156.          Top             =   360
  157.          Width           =   555
  158.       End
  159.       Begin VB.Label lblStep 
  160.          Alignment       =   1  'Right Justify
  161.          BorderStyle     =   1  'Fixed Single
  162.          Height          =   285
  163.          Left            =   1170
  164.          TabIndex        =   26
  165.          Top             =   720
  166.          Width           =   555
  167.       End
  168.       Begin VB.Label lblPart 
  169.          Alignment       =   1  'Right Justify
  170.          BorderStyle     =   1  'Fixed Single
  171.          Height          =   285
  172.          Left            =   1170
  173.          TabIndex        =   29
  174.          Top             =   1080
  175.          Width           =   555
  176.       End
  177.    End
  178.    Begin VB.Frame Frame2 
  179.       Caption         =   "&Configuration"
  180.       Height          =   3165
  181.       Left            =   5400
  182.       TabIndex        =   9
  183.       Top             =   90
  184.       Width           =   3345
  185.       Begin VB.CheckBox chkAutomatic 
  186.          Alignment       =   1  'Right Justify
  187.          Caption         =   "Use &automatic resize/rename/delete"
  188.          Height          =   285
  189.          Left            =   270
  190.          TabIndex        =   20
  191.          Top             =   2700
  192.          Value           =   1  'Checked
  193.          Width           =   2895
  194.       End
  195.       Begin VB.ComboBox cmbMode 
  196.          Height          =   315
  197.          ItemData        =   "frmMCSanitizerDemo.frx":030A
  198.          Left            =   2340
  199.          List            =   "frmMCSanitizerDemo.frx":0317
  200.          TabIndex        =   17
  201.          Text            =   "3"
  202.          Top             =   1530
  203.          Width           =   825
  204.       End
  205.       Begin VB.CheckBox chkBuffers 
  206.          Alignment       =   1  'Right Justify
  207.          Caption         =   "Use &buffers"
  208.          Height          =   285
  209.          Left            =   270
  210.          TabIndex        =   18
  211.          Top             =   1980
  212.          Width           =   2895
  213.       End
  214.       Begin VB.ComboBox cmbPassages 
  215.          Height          =   315
  216.          ItemData        =   "frmMCSanitizerDemo.frx":0324
  217.          Left            =   2340
  218.          List            =   "frmMCSanitizerDemo.frx":0349
  219.          TabIndex        =   13
  220.          Text            =   "7"
  221.          Top             =   810
  222.          Width           =   825
  223.       End
  224.       Begin VB.TextBox txtChar 
  225.          Alignment       =   1  'Right Justify
  226.          Height          =   285
  227.          Left            =   2700
  228.          MaxLength       =   1
  229.          TabIndex        =   11
  230.          Text            =   "U"
  231.          Top             =   360
  232.          Width           =   465
  233.       End
  234.       Begin VB.CheckBox chkRandomPattern 
  235.          Alignment       =   1  'Right Justify
  236.          Caption         =   "Use same &random pattern"
  237.          Height          =   285
  238.          Left            =   270
  239.          TabIndex        =   19
  240.          Top             =   2340
  241.          Value           =   1  'Checked
  242.          Width           =   2895
  243.       End
  244.       Begin VB.ComboBox cmbBufferSize 
  245.          Height          =   315
  246.          ItemData        =   "frmMCSanitizerDemo.frx":0372
  247.          Left            =   2340
  248.          List            =   "frmMCSanitizerDemo.frx":0391
  249.          TabIndex        =   15
  250.          Text            =   "16384"
  251.          Top             =   1170
  252.          Width           =   825
  253.       End
  254.       Begin VB.Label Label2 
  255.          AutoSize        =   -1  'True
  256.          Caption         =   "&Mode"
  257.          Height          =   195
  258.          Index           =   7
  259.          Left            =   270
  260.          TabIndex        =   16
  261.          Top             =   1620
  262.          Width           =   465
  263.       End
  264.       Begin VB.Label Label2 
  265.          AutoSize        =   -1  'True
  266.          Caption         =   "&Passages"
  267.          Height          =   195
  268.          Index           =   6
  269.          Left            =   270
  270.          TabIndex        =   12
  271.          Top             =   810
  272.          Width           =   735
  273.       End
  274.       Begin VB.Label Label2 
  275.          AutoSize        =   -1  'True
  276.          Caption         =   "&Char"
  277.          Height          =   195
  278.          Index           =   5
  279.          Left            =   270
  280.          TabIndex        =   10
  281.          Top             =   360
  282.          Width           =   375
  283.       End
  284.       Begin VB.Label Label2 
  285.          AutoSize        =   -1  'True
  286.          Caption         =   "Buffer &size"
  287.          Height          =   195
  288.          Index           =   4
  289.          Left            =   270
  290.          TabIndex        =   14
  291.          Top             =   1260
  292.          Width           =   735
  293.       End
  294.    End
  295.    Begin VB.Frame Frame1 
  296.       Caption         =   "&Select a file"
  297.       Height          =   3165
  298.       Left            =   90
  299.       TabIndex        =   0
  300.       Top             =   90
  301.       Width           =   5235
  302.       Begin VB.TextBox txtFileName 
  303.          Height          =   285
  304.          Left            =   180
  305.          Locked          =   -1  'True
  306.          TabIndex        =   8
  307.          Top             =   2700
  308.          Width           =   4875
  309.       End
  310.       Begin VB.FileListBox File1 
  311.          Height          =   1650
  312.          Left            =   2430
  313.          TabIndex        =   6
  314.          Top             =   630
  315.          Width           =   2625
  316.       End
  317.       Begin VB.DirListBox Dir1 
  318.          Height          =   990
  319.          Left            =   180
  320.          TabIndex        =   4
  321.          Top             =   1350
  322.          Width           =   2175
  323.       End
  324.       Begin VB.DriveListBox Drive1 
  325.          Height          =   315
  326.          Left            =   180
  327.          TabIndex        =   2
  328.          Top             =   630
  329.          Width           =   2175
  330.       End
  331.       Begin VB.Label Label2 
  332.          AutoSize        =   -1  'True
  333.          Caption         =   "Selected file"
  334.          Height          =   195
  335.          Index           =   3
  336.          Left            =   180
  337.          TabIndex        =   7
  338.          Top             =   2430
  339.          Width           =   870
  340.       End
  341.       Begin VB.Label Label2 
  342.          AutoSize        =   -1  'True
  343.          Caption         =   "File"
  344.          Height          =   195
  345.          Index           =   2
  346.          Left            =   2430
  347.          TabIndex        =   5
  348.          Top             =   360
  349.          Width           =   240
  350.       End
  351.       Begin VB.Label Label2 
  352.          AutoSize        =   -1  'True
  353.          Caption         =   "Directory"
  354.          Height          =   195
  355.          Index           =   1
  356.          Left            =   180
  357.          TabIndex        =   3
  358.          Top             =   1080
  359.          Width           =   630
  360.       End
  361.       Begin VB.Label Label2 
  362.          AutoSize        =   -1  'True
  363.          Caption         =   "Disk"
  364.          Height          =   195
  365.          Index           =   0
  366.          Left            =   180
  367.          TabIndex        =   1
  368.          Top             =   360
  369.          Width           =   315
  370.       End
  371.    End
  372.    Begin VB.CommandButton Command1 
  373.       Caption         =   "Sanitize"
  374.       BeginProperty Font 
  375.          Name            =   "Arial"
  376.          Size            =   33.75
  377.          Charset         =   0
  378.          Weight          =   400
  379.          Underline       =   0   'False
  380.          Italic          =   0   'False
  381.          Strikethrough   =   0   'False
  382.       EndProperty
  383.       Height          =   1455
  384.       Left            =   5400
  385.       Picture         =   "frmMCSanitizerDemo.frx":03B0
  386.       Style           =   1  'Graphical
  387.       TabIndex        =   37
  388.       Top             =   3420
  389.       Width           =   3345
  390.    End
  391.    Begin VB.Menu mnu_Exit 
  392.       Caption         =   "E&xit"
  393.    End
  394. Attribute VB_Name = "frmMCSanitizerDemo"
  395. Attribute VB_GlobalNameSpace = False
  396. Attribute VB_Creatable = False
  397. Attribute VB_PredeclaredId = True
  398. Attribute VB_Exposed = False
  399. Option Explicit
  400. Private Sub Command1_Click()
  401.    Command1.Enabled = False
  402.    DoEvents
  403.    Dim iStatus             As Integer
  404.    If (MsgBox("Are you sure to sanitize the file" & vbCrLf & vbCrLf & txtFileName.Text & " ?", vbYesNo, "mcSanitizer : Warning") = vbNo) Then
  405.       File1.Refresh
  406.       Command1.Enabled = True
  407.       Exit Sub
  408.    End If
  409.    mcSanitizer1.filename = txtFileName.Text
  410.    mcSanitizer1.Char = txtChar.Text
  411.    mcSanitizer1.Passages = Val(cmbPassages.Text)
  412.    mcSanitizer1.BufferSize = Val(cmbBufferSize.Text)
  413.    mcSanitizer1.NewFileName = ""
  414.    mcSanitizer1.UseBuffers = chkBuffers.Value
  415.    mcSanitizer1.UseSameRandomPattern = chkRandomPattern.Value
  416.    mcSanitizer1.Mode = Val(cmbMode.Text)
  417.    mcSanitizer1.Automatic = chkAutomatic.Value
  418.    lblPassages.Caption = mcSanitizer1.Passages
  419.    lblSteps.Caption = mcSanitizer1.Mode
  420.    lblParts.Caption = mcSanitizer1.Parts
  421.    iStatus = mcSanitizer1.Sanitize
  422.    If (iStatus <> True) Then
  423.       MsgBox "An error has occured" & vbCrLf & _
  424.              "mcSanitizer code is " & iStatus & vbCrLf & _
  425.              "VB error number is " & mcSanitizer1.LastErrorNumber & vbCrLf & _
  426.              "VB error description is " & mcSanitizer1.LastErrorDescription
  427.    End If
  428.    lblTime(0).Caption = mcSanitizer1.TimeForChar
  429.    lblTime(1).Caption = mcSanitizer1.TimeForCharComplement
  430.    lblTime(2).Caption = mcSanitizer1.TimeForCharRandom
  431.    If (mcSanitizer1.Automatic = False) Then
  432.       If (MsgBox("Because you set the .Automatic property to False, " & vbCrLf & "you need to resize the file to zero length, " & vbCrLf & "then rename it and then delete it." & vbCrLf & vbCrLf & "Do you want the mcSanitizer does it (.Delete method) ?", vbYesNo) = vbYes) Then
  433.          iStatus = mcSanitizer1.Delete
  434.          If (iStatus <> True) Then
  435.             MsgBox "An error has occured" & vbCrLf & _
  436.                    "mcSanitizer code is " & iStatus & vbCrLf & _
  437.                    "VB error number is " & mcSanitizer1.LastErrorNumber & vbCrLf & _
  438.                    "VB error description is " & mcSanitizer1.LastErrorDescription
  439.          End If
  440.       End If
  441.    End If
  442.    File1.Refresh
  443.    Command1.Enabled = True
  444. End Sub
  445. Private Sub Dir1_Change()
  446.    File1.Path = Dir1.Path
  447. End Sub
  448. Private Sub Drive1_Change()
  449.    Dir1.Path = Drive1.Drive
  450. End Sub
  451. Private Sub File1_Click()
  452.    txtFileName.Text = Dir1.Path + "\" + File1.filename
  453. End Sub
  454. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  455.    Unload frmMCSanitizerDemo
  456. End Sub
  457. Private Sub mcSanitizer1_BeginPassage(iPassage As Integer)
  458.    lblPassage.Caption = iPassage
  459.    lblStep.Caption = "0"
  460.    lblPart.Caption = "0"
  461.    DoEvents
  462. End Sub
  463. Private Sub mcSanitizer1_EndPassage(iPassage As Integer)
  464.    lblPassage.Caption = iPassage
  465.    DoEvents
  466. End Sub
  467. Private Sub mcSanitizer1_BeginStep(iPassage As Integer, iStep As Integer)
  468.    lblStep.Caption = iStep
  469.    DoEvents
  470. End Sub
  471. Private Sub mcSanitizer1_EndStep(iPassage As Integer, iStep As Integer)
  472.    lblStep.Caption = iStep
  473.    DoEvents
  474. End Sub
  475. Private Sub mcSanitizer1_BeginPart(iPassage As Integer, iStep As Integer, lPart As Long)
  476.    lblPart.Caption = lPart
  477.    DoEvents
  478. End Sub
  479. Private Sub mcSanitizer1_EndPart(iPassage As Integer, iStep As Integer, lPart As Long)
  480.    lblPart.Caption = lPart
  481.    DoEvents
  482. End Sub
  483. Private Sub mcSanitizer1_Error(iError As MC_Sanitizer.mcEnumError)
  484.    MsgBox "An error has occured" & vbCrLf & _
  485.           "mcSanitizer code is " & iError & vbCrLf & _
  486.           "VB error number is " & mcSanitizer1.LastErrorNumber & vbCrLf & _
  487.           "VB error description is " & mcSanitizer1.LastErrorDescription, , "mcSanitizer : Error event"
  488. End Sub
  489. Private Sub mnu_Exit_Click()
  490.    Unload frmMCSanitizerDemo
  491. End Sub
  492.